package test;

import java.util.Scanner;

public class Main {
	private static int count;

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		int[] a = new int[size];
		for (int i = 0; i < size; i++) {
			a[i] = sc.nextInt();
		}
		for (int b : a) {
			fun(b);
		}
		System.out.println(count);
	}// main

	public static void fun(int b) {
		if (isPrime(b)) {
			count++;
		}
		cut(b);

	}

	static boolean isPrime(int b) {
		for (int i = 2; i < b; i++) {
			if (b % i == 0) {
				return false;
			}
		}
		return b != 1;
	}

	static void cut(int b) {
		int i = 0;
		for (i = 2; i < b; i++) {
			if (isPrime(i)) {
				count ++;
			}
		}
	}
}
